package com.dongjiantong.openplatform.core;/**
 * Created by cao on 2017/12/13.
 */

/**
 * @author cao
 * @create 2017-12-13 下午8:28
 **/
import com.dongjiantong.openplatform.entity.OPClientInfo;

import java.beans.ConstructorProperties;
import java.io.Serializable;
import java.util.Map;

public class OPPushEvent implements Serializable {
    OPClientInfo clientInfo;
    String method;
    Map<String, Object> params;

    public OPClientInfo getClientInfo() {
        return this.clientInfo;
    }

    public String getMethod() {
        return this.method;
    }

    public Map<String, Object> getParams() {
        return this.params;
    }

    public void setClientInfo(OPClientInfo clientInfo) {
        this.clientInfo = clientInfo;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public void setParams(Map<String, Object> params) {
        this.params = params;
    }

    @Override
    public boolean equals(Object o) {
        if(o == this) {
            return true;
        } else if(!(o instanceof OPPushEvent)) {
            return false;
        } else {
            OPPushEvent other = (OPPushEvent)o;
            if(!other.canEqual(this)) {
                return false;
            } else {
                label47: {
                    Object this$clientInfo = this.getClientInfo();
                    Object other$clientInfo = other.getClientInfo();
                    if(this$clientInfo == null) {
                        if(other$clientInfo == null) {
                            break label47;
                        }
                    } else if(this$clientInfo.equals(other$clientInfo)) {
                        break label47;
                    }

                    return false;
                }

                Object this$method = this.getMethod();
                Object other$method = other.getMethod();
                if(this$method == null) {
                    if(other$method != null) {
                        return false;
                    }
                } else if(!this$method.equals(other$method)) {
                    return false;
                }

                Object this$params = this.getParams();
                Object other$params = other.getParams();
                if(this$params == null) {
                    if(other$params != null) {
                        return false;
                    }
                } else if(!this$params.equals(other$params)) {
                    return false;
                }

                return true;
            }
        }
    }

    public boolean canEqual(Object other) {
        return other instanceof OPPushEvent;
    }

    @Override
    public int hashCode() {
        //int PRIME = true;
        int result = 1;
        Object $clientInfo = this.getClientInfo();
         result = result * 31 + ($clientInfo == null?0:$clientInfo.hashCode());
        Object $method = this.getMethod();
        result = result * 31 + ($method == null?0:$method.hashCode());
        Object $params = this.getParams();
        result = result * 31 + ($params == null?0:$params.hashCode());
        return result;
    }

    @Override
    public String toString() {
        return "OPPushEvent(clientInfo=" + this.getClientInfo() + ", method=" + this.getMethod() + ", params=" + this.getParams() + ")";
    }

    @ConstructorProperties({"clientInfo", "method", "params"})
    public OPPushEvent(OPClientInfo clientInfo, String method, Map<String, Object> params) {
        this.clientInfo = clientInfo;
        this.method = method;
        this.params = params;
    }
}

